<?php

namespace app\admin\controller;

use think\Controller;
use think\facade\Session;

class Base extends Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->checklogin();

        $this->assign('name', Session::get('name'));

    }

    public function checklogin()
    {
         if(!Session::get('name')){
            $this->redirect('/login');
         }
    }

}
